package com.bwie.controller;

import com.bwie.pojo.TbReport;
import com.bwie.service.TbNetworkService;
import com.bwie.utils.R;
import com.bwie.vo.PageInfoVo;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/district/index")
public class IndexController {
    @Resource
    TbNetworkService tbNetworkService;


    /**
     * 分页获取网办类型页面
     * @param pageInfoVo
     * @return
     */
    @PostMapping("/getNetworkList")
    public R getNetworkList(@RequestBody PageInfoVo pageInfoVo){
        return tbNetworkService.getNetworkList(pageInfoVo);
    }


    /**
     * 分页获取授权机构列表页面
     * @param pageInfoVo
     * @return
     */
    @PostMapping("/getInstitutionList")
    public R getInstitutionList(@RequestBody PageInfoVo pageInfoVo){
        return tbNetworkService.getInstitutionList(pageInfoVo);
    }


    /**
     * 分页获取上报数据展示页面
     * @param pageInfoVo
     * @return
     */
    @PostMapping("/getReportList")
    public R getReportList(@RequestBody PageInfoVo pageInfoVo){
        return tbNetworkService.getReportList(pageInfoVo);
    }

    @PostMapping("/addReport")
    public R addReport(@RequestBody TbReport tbReport){
        return tbNetworkService.addReport(tbReport);
    }
}
